#!/bin/bash
currentDate=`date '+%Y%m%d'`
currentDateFormat=`date '+%Y-%m-%d'`
/opt/lagou/servers/hive-2.3.7/bin/hive -S -e "alter table homework.user_clicks add partition(dt='${currentDateFormat}')"
/opt/lagou/servers/hive-2.3.7/bin/hive -S -e "load data inpath '/user_clicks/${currentDate}/clicklog.dat' into table homework.user_clicks partition(dt='${currentDateFormat}')"